

package com.hex.ds.code.detection.publish.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hex.ds.code.detection.common.base.PageResult;
import com.hex.ds.code.detection.publish.entity.ScriptPublishTaskEntity;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.List;

/**
 * 脚本发布任务
 *
 * @author Wang zhihao
 * @date 2023-09-13 18:16:07
 */
public interface IScriptPublishTaskService extends IService<ScriptPublishTaskEntity> {

    /**
     * @Method queryList
     * @Param
     * @param page
     * @param scriptPublishTask
     * @Return com.hex.ds.code.detection.common.base.PageResult
     * @Description 分页查询脚本发布任务并返回PageResult类型的数据
     * @Author Wang zhihao
     * @Date 2023/9/14 17:10
     * @Version V1.0
     */
    PageResult queryList(Page page, ScriptPublishTaskEntity scriptPublishTask);

    /**
     * @Method queryListNoPage
     * @Param
     * @param scriptPublishTask
     * @Return java.util.List<com.hex.ds.code.detection.script.publish.entity.ScriptPublishTaskEntity>
     * @Description 不分页查询
     * @Author Wang zhihao
     * @Date 2023/11/30 13:14
     * @Version V1.0
     */
    List<ScriptPublishTaskEntity> queryListNoPage(ScriptPublishTaskEntity scriptPublishTask);

    /**
     * @Method removeByIds
     * @Param
     * @param ids
     * @Return void
     * @Description 批量删除
     * @Author Wang zhihao
     * @Date 2023/9/14 19:07
     * @Version V1.0
     */
    void removeByIds(List<String> ids);

    /**
     * @Method removeById
     * @Param
     * @param id
     * @Return void
     * @Description 根据ID删除
     * @Author Wang zhihao
     * @Date 2023/11/13 16:36
     * @Version V1.0
     */
    void removeById(String id);

    /**
     * @Method removeByVersionId
     * @Param
     * @param versionId
     * @Return void
     * @Description 根据版本ID删除
     * @Author Wang zhihao
     * @Date 2023/11/29 18:45
     * @Version V1.0
     */
    void removeByVersionId(String versionId);

    /**
     * @Method upload
     * @Param
     * @param multipartFileList
     * @Return java.util.List<java.io.File>
     * @Description 上传
     * @Author Wang zhihao
     * @Date 2023/9/14 19:15
     * @Version V1.0
     */
    List<File> upload(List<MultipartFile> multipartFileList);

    /**
     * @Method addPublishTask
     * @Param
     * @param scriptPublishTask
     * @Return void
     * @Description 添加发布任务
     * @Author Wang zhihao
     * @Date 2023/11/29 16:08
     * @Version V1.0
     */
    void addPublishTask(ScriptPublishTaskEntity scriptPublishTask);

    /**
     * @Method restore
     * @Param
     * @param publishTaskId
     * @param clusterId
     * @Return void
     * @Description 将发布的还原
     * @Author Wang zhihao
     * @Date 2023/10/19 15:11
     * @Version V1.0
     */
    void restore(String publishTaskId, String clusterId);

    /**
     * @Method modifyFailNum
     * @Param
     * @param taskId
     * @Return void
     * @Description 更新成功数量
     * @Author Wang zhihao
     * @Date 2023/12/1 16:07
     * @Version V1.0
     */
    void modifyPublishSuccessNum(String taskId);

    /**
     * @Method modifyFailNum
     * @Param
     * @param taskId
     * @Return void
     * @Description 更新失败数量
     * @Author Wang zhihao
     * @Date 2023/12/1 16:07
     * @Version V1.0
     */
    void modifyPublishFailNum(String taskId);

    /**
     * @Method modifyRestoreSuccessNum
     * @Param
     * @param taskId
     * @Return void
     * @Description 更新成功数量
     * @Author Wang zhihao
     * @Date 2023/12/1 16:07
     * @Version V1.0
     */
    void modifyRestoreSuccessNum(String taskId);

    /**
     * @Method modifyRestoreFailNum
     * @Param
     * @param taskId
     * @Return void
     * @Description 更新失败数量
     * @Author Wang zhihao
     * @Date 2023/12/1 16:07
     * @Version V1.0
     */
    void modifyRestoreFailNum(String taskId);

}
